/*
 * @Author: zulezhe
 * @Date: 2022-03-25 16:37:39
 * @LastEditors: zulezhe
 * @LastEditTime: 2022-03-28 10:20:48
 * @Path: https://gitee.com/zulezhe/
 * @Description:
 */
/**
 * @param {string} path
 * @returns {Boolean}
 */
export function isExternal(path) {
  return /^(https?:|mailto:|tel:)/.test(path);
}

/**
 * @param {string} str
 * @returns {Boolean}
 */
export function validUsername(str) {
  const valid_map = ["admin", "editor"];
  return valid_map.indexOf(str.trim()) >= 0;
}
